Skip to content

Conversation

haruki1243
Copy link

@haruki1243 haruki1243 commented Oct 16, 2025

Description

fix issue 18446 NPE by making sure scoreSupplier.get() returns non-null scorer

Related Issues

Resolves #[18446]

Check List

  • Functionality includes testing.
  • API changes companion pull request created, if applicable.
  • Public documentation issue/PR created, if applicable.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@haruki1243 haruki1243 requested a review from a team as a code owner October 16, 2025 01:23
@github-actions github-actions bot added bug Something isn't working lucene Search Search query, autocomplete ...etc labels Oct 16, 2025
@haruki1243 haruki1243 changed the title fix issue 18446 NPE by making sure scoreSupplier.get() returns non-nulll scorer fix issue 18446 NPE by making sure scoreSupplier.get() returns non-null scorer Oct 16, 2025
Copy link
Contributor

❌ Gradle check result for 19d098a: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@gaobinlong
Copy link
Contributor

Thanks @haruki1243, the spotlessJavaCheck gradle task failed, please run ./gradlew :server:spotlessApply and then ./gradlew :server:check to make sure the main part of gradle checks can pass. Unit test and yaml rest test are needed, changelog is also needed.

Weight subQueryWeight = subQuery.createWeight(searcher, subQueryScoreMode, 1.0f);

return new Weight(this) {

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would need a test for this change as well

@haruki1243
Copy link
Author

haruki1243 commented Oct 16, 2025

Hi @gaobinlong @owaiskazi19

Thank you so much for your reply. I have made the requested changes, including apotless formatting, tests and changelog

I added test cases to ScriptScoreQueryTests and ScriptScoreQueryIT. both pass. You can try to replace the implementation of ScriptScoreQuery with the old one, and you will see both of them fail.

Regarding yaml rest tests, sorry I didn't find tests that uses script score in those yaml tests, and ScriptScoreQueryIT seems to be the right place for its integration test instead.

Copy link
Contributor

❌ Gradle check result for 29f7ccd: null

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@haruki1243
Copy link
Author

❌ Gradle check result for 29f7ccd: null

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Looks like Jenkins is down

Trigger Jenkins workflows
{"pr_from_sha": "29f7ccd3b63d053ed318383ad421472c90e06991", "pr_from_clone_url": "https://github.com/haruki1243/OpenSearch.git", "pr_to_clone_url": "https://github.com/opensearch-project/OpenSearch.git", "pr_title": "fix issue 18446 npe by making sure scoresupplierget returns nonnull scorer", "pr_number": "19650", "post_merge_action": "false", "pr_owner": "haruki1243"}

<title>403 Forbidden</title>

403 Forbidden

jq: parse error: Invalid numeric literal at line 1, column 7 QUEUE_URL wait for jenkins to start workflow Check if queue exist in Jenkins after triggering Use queue information to find build number in Jenkins if available

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working lucene Search Search query, autocomplete ...etc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Null pointer exception on a term filter nested inside a script score

3 participants